package com.bw.cashier.adapter

import android.view.View
import android.widget.CheckBox
import android.widget.TextView
import com.bw.cashier.R
import com.bw.cashier.entity.ChargeDataEntityItem
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class BillAdapter:BaseQuickAdapter<ChargeDataEntityItem, BaseViewHolder>(R.layout.item_bill) {
    override fun convert(holder: BaseViewHolder, item: ChargeDataEntityItem) {
        holder.getView<TextView>(R.id.bill_date).text = item.effectiveDate.substring(0,7)
        holder.getView<TextView>(R.id.bill_sum).text = "￥${item.actualAmount}.00"
        holder.getView<CheckBox>(R.id.checked).isChecked = item.isChecked
        holder.getView<TextView>(R.id.cashier_rv_type).text = item.chargeType
        holder.getView<TextView>(R.id.cashier_rv_date).text = item.paymentTime
        holder.getView<TextView>(R.id.cashier_money).text = "￥${item.actualAmount}.00"
        val checkBox = holder.getView<CheckBox>(R.id.checked)
        checkBox.isChecked=item.isChecked
    }
}